package mysql

import "gorm.io/gorm"

type Brand struct {
	gorm.Model
	Name string `gorm:"type:varchar(30);not null;commit:品牌名称"`
}

func (b *Brand) FindBrandByName(db *gorm.DB, name string) error {
	return db.Debug().Where("name = ?", name).FirstOrCreate(b).Error
}

//func (b *Brand) BrandAdd(db *gorm.DB) error {
//	return db.Debug().Create(b).Error
//}
